<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition template="../template/template.xhtml"
    xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<body>
	
	<!--modal para cadastro do estabelecimento -->
	
		<ui:define name="content">
			<h:form id="formCliente">
			
			<p:panel header="Cadastrar Cliente:" styleClass="conteudo">
				
				<br></br>
				<h:panelGrid id="grid1" columns="12" style="margin-bottom:10px">  
		            <h:outputLabel styleClass="label_10" for="nome" value="#{msg.label_nome} "/><strong>*</strong>  
		            <p:inputText id="nome" value="#{clienteMB.cliente.nome}" size="35" />
		          	
		          	<h:outputLabel styleClass="label_16" for="sobrenome" value="#{msg.label_sobr} " /><strong>*</strong>  
		            <p:inputText id="sobrenome" value="#{clienteMB.cliente.sobrenome}" size="35" />  
		            
		            <h:outputLabel  styleClass="label_80" for="cpf" value="#{msg.label_cpf} " /><strong>*</strong>  
		            <p:inputMask id="cpf" value="#{clienteMB.cliente.cpf}" size="35" mask="999.999.999-99" />
       		   </h:panelGrid>
			   
				<h:panelGrid columns="7" styleClass="label_27" >
					<h:outputLabel for="cep" value="#{msg.label_cep} " />
					<p:inputMask id="cep" value="#{clienteMB.cliente.cep}" size="15" mask="99999-999"/>
					
					<p:commandButton ajax="false" id="buscarCEP"  update="rua cidade bairro modal" action="#{clienteMB.buscarEndereco}" value="#{msg.btn_buscar}" />
					
					<h:outputLabel styleClass="label_110" for="rua" value="#{msg.label_rua} " />
					<p:inputText  id="rua" value="#{clienteMB.cliente.rua}" size="40"/>

					<h:outputLabel styleClass="label_40" for="num" value="#{msg.label_numero} " />
					<p:inputText id="num" value="#{clienteMB.cliente.numero}" size="4" />
				</h:panelGrid>

				<br></br>

				<h:panelGrid columns="6" styleClass="label_20">
					<h:outputLabel for="bairro" value="Bairro: " />
					<p:inputText id="bairro" value="#{clienteMB.cliente.bairro}" size="25" />

					<h:outputLabel styleClass="label_110" for="cidade" value="#{msg.label_cidade} " />
					<p:inputText id="cidade" value="#{clienteMB.cliente.cidade}" size="25" />

					<h:outputLabel styleClass="label_135" value="#{msg.label_uf} "></h:outputLabel>
					<p:selectOneMenu style="width:65px;" id="estado"
						value="#{clienteMB.cliente.uf}">
						<f:selectItems value="#{clienteMB.ufs}"></f:selectItems>
					</p:selectOneMenu>
				</h:panelGrid>
				
				<br></br>
				<h:panelGrid columns="6" style="margin-bottom:10px">
					<h:outputLabel for="telefone" value="#{msg.label_res} " />
					<p:inputMask id="telefone" style="margin-left:4px;" value="#{clienteMB.cliente.telResidencial}" size="15" mask="(99) 9999-9999" />

					<h:outputLabel styleClass="label_175" for="celular" value="#{msg.label_cel} " />
					<p:inputMask id="celular" value="#{clienteMB.cliente.celular}" size="15" mask="(99) 99999-9999" />
					
					<h:outputLabel styleClass="label_198" for="email" value="Email: " />
					<p:inputText id="email" value="#{clienteMB.cliente.celular}" size="25" />
				</h:panelGrid>
				<br></br>

				<h:panelGrid columns="2" style="margin-bottom:10px">
					<h:outputLabel for="obs" value="#{msg.label_obs} " />
					<p:inputTextarea id="obs" style="margin-left:25px;" value="#{clienteMB.cliente.observacao}" rows="8" cols="80" autoResize="false" />
				</h:panelGrid>

				 <p:commandButton  ajax="false" action="#{clienteMB.salvar}" update="modal nome" value="#{msg.btn_cadastrar}" style="margin-left:1170px; margin-top: 80px;" >
				 	<f:actionListener type="casamento.util.ValidaCliente"></f:actionListener>
				 </p:commandButton>
				 
				 <p style="margin-top: -10px;"><strong>(*) </strong> Campos Obrigatórios.</p>
			</p:panel>
				
</h:form>

</ui:define>

</body>
</ui:composition>
